<?php
$App = Blyn::app()->getActiveApp();
$InfoList = $App->getEventList();
?>
<?php
$availableUrl = $control->getLinkUrl(array('name' => 'available','id' => 'booking_list_available'));
$myBookingUrl = $control->getLinkUrl(array('name' => 'myBooking','id' => 'booking_list_myBooking'));
?>
<div style="font-family: 微软雅黑; font-size: 14px; line-height: 28px">
    <div style="height:28px;width:100%;border:1px solid #dedede;">
        <a href="<?php echo $availableUrl;?>" style="text-decoration: none;text-align:center;float:left; width:32%;"><div>可预订</div></a>
        <a href="#" style="text-decoration: none;text-align:center;float:left; width:32%; border-left:1px solid #dedede;border-right:1px solid #dedede; background-color:#E9E9E9;"><div>所有场地</div></a>
        <a href="<?php echo $myBookingUrl;?>" style="text-decoration: none;text-align:center;float:left; width:32%;"><div>我的预定</div></a>
    </div>
    <?php
    foreach ($InfoList as $id => $event) {
        //  $eventType = $event->getGroup(array('parent' => BWEventGroup::EVENT_TYPE))->getName();
        ?>
        <?php
//        $eventDetal = new BWEvent($id);
//        try {
//            $eventPic = $eventDetal->getMediaManager()->getMedia('image')->getContent(); //读图片地址
//        } catch (Exception $e) {
           $eventPic ='/images/mobile/place1.jpg';
//          //  print $e->getMessage();
//        }
        ?>

        <div style="border: 1px solid #dedede; padding: 8px 8px; background-color: white; margin: 10px;">
            <div style="text-align: center;margin-bottom: 4px;padding:0 1px;">
                <img src="<?php echo Yii::app()->request->baseUrl . $eventPic; ?>" style="width:100%; height:130px;"/>
            </div>
            <div style="padding: 0;">
                <a href="#"><div style="font-weight: bold; color:blueviolet;"><?php echo $event->name; ?></div></a>
                <p><?php echo '场地简介：'.$event->description ?></p>
                <p><?php echo '开始时间:'.$event->startTime ?></p> <p><?php echo '结束时间:'.$event->endTime ?></p>
                <div style="font-weight: bold; color:#dedede;"><?php echo $control->getLink('场地信息', array('eventID' => $id)); ?></div>
            </div>
        </div>
    <?php } ?>
</div>